//
// Created by 10334 on 2022/9/26.
//

#ifndef HYBRID_TASK_MESSAGE_ELEMENT_H
#define HYBRID_TASK_MESSAGE_ELEMENT_H

#include <vector>
#include <string>

using std::vector;
using std::string;

class Node {
public:
	Node(int identifier, string *category, int hyper_period, int utilization, vector<int> *con_task);

	int identifier;
	string *category;
	int hyper_period;
	int utilization;
	vector<int> *con_task;
};

class Link {
public:
	Link(int identifier, int src_node, int des_node, int hyper_period, int utilization, vector<int> *con_message);

	int identifier;
	int src_node;
	int des_node;
	int hyper_period;
	int utilization;
	vector<int> *con_message;
};

class Function {
public:
	Function(int identifier, vector<int>*con_task, int rct_delay, int age_delay);

	int identifier;
	vector<int>*con_task;
	int rct_delay;
	int age_delay;
};

class Task {
public:
	Task(int identifier, Node* res_node, int period, double length, string *state,
	     int offset, int rct_instance, int age_instance);

	int identifier;
	Node* res_node;
	int period;
	double length;
	string *state;//ignore
	int offset;//ignore
	int rct_instance;//ignore
	int age_instance;//ignore
};

class Message {
public:
	Message(int identifier, int src_node,
	        int des_node, int period, int length,
	        double bandwidth, string *state, int inject, vector<int> *path, vector<int> *offset,
	        int communication_delay);

	int identifier;
	//Task* src_task;//ignore
	int src_node;
	//Task* des_task;//ignore
	int des_node;
	int period;
	int length;
	double bandwidth;//ignore
	string *state;//ignore
	int inject;//ignore
	vector<int> *path;//ignore
	vector<int> *offset;//ignore
	int communication_delay;//ignore
};

class Avionics {
public:
	Avionics(string *net_case, int time_out, double accuracy);

	string *net_case;
	int time_out;//ignore
	double accuracy;//ignore

	vector<Node *>* all_node;
	//self.all_node = load.load_all_node(self.case)
	vector<Link *>* all_link;
	//self.all_link = load.load_all_link(self.case, self.all_node)
	vector<Function *>* all_function;//ignore
	//self.all_function = load.load_all_function(self.case)
	vector<Task *>* all_task;//ignore
	//self.all_task = load.load_all_task(self.case, self.all_node)
	vector<Message *>* all_message;
	//self.all_message = load.load_all_messsage(self.case, self.all_task)
	int average_com_delay;//ignore
	int average_rct_delay;//ignore
	int average_age_delay;//ignore
	int schedulable_message_count;//ignore
	int schedulable_function_count;//ignore
	vector<int> *running_duration;//ignore
	vector<int> *optimization_log;//ignore
};


#endif //HYBRID_TASK_MESSAGE_ELEMENT_H
